<html>
<head><meta charset="utf-8"><title>chaining of comparisons · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html">chaining of comparisons</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="207141908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207141908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hossein dindar <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207141908">(Aug 17 2020 at 13:14)</a>:</h4>
<p>Hi guys, can anyone please tell me that if I want to fix <code>chaining of comparisons</code> issue, where should I start to read the code?<br>
I don't know that it is a silly question or not, but because I am new to rust and don't know about compiler structure, I need a little help from you guys<br>
thanks</p>



<a name="207141942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207141942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207141942">(Aug 17 2020 at 13:14)</a>:</h4>
<p>You mean allowing <code>3 &lt;= x &lt;= 7</code>?</p>



<a name="207142060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142060">(Aug 17 2020 at 13:15)</a>:</h4>
<p>I don't think that's possible to fix, at least not without a bunch of design work and an RFC. The issue is that comparison operators are implemented via the <code>PartialOrd</code>/<code>Ord</code> traits, and those can't handle chaining.</p>



<a name="207142192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142192">(Aug 17 2020 at 13:16)</a>:</h4>
<p>Can't it be desugared to <code>3 &lt;= x &amp;&amp; x &lt;= 7</code>?</p>



<a name="207142215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142215">(Aug 17 2020 at 13:17)</a>:</h4>
<p>Most pre-RFCs happen on <a href="https://internals.rust-lang.org/">IRLO</a>, so you may want to create discussions there</p>



<a name="207142427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hossein dindar <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142427">(Aug 17 2020 at 13:19)</a>:</h4>
<p>yes, ok, so I should pick another issue to fix <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> <br>
I will take a look at issues and see which one is easy to start<br>
or if there is anyone that you offer to fix, I will appreciate that</p>



<a name="207142429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142429">(Aug 17 2020 at 13:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/chaining.20of.20comparisons/near/207142192">said</a>:</p>
<blockquote>
<p>Can't it be desugared to <code>3 &lt;= x &amp;&amp; x &lt;= 7</code>?</p>
</blockquote>
<p>That's a possibility, yeah, but it needs to go through an RFC since it's a nontrivial language change</p>



<a name="207142590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142590">(Aug 17 2020 at 13:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="326330">hossein dindar</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/chaining.20of.20comparisons/near/207142427">said</a>:</p>
<blockquote>
<p>yes, ok, so I should pick another issue to fix <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> <br>
I will take a look at issues and see which one is easy to start<br>
or if there is anyone that you offer to fix, I will appreciate that</p>
</blockquote>
<p>You can probably send a private message to <span class="user-mention" data-user-id="120823">@DPC</span>, I know they like to help people find issues to work on</p>



<a name="207142734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hossein dindar <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142734">(Aug 17 2020 at 13:21)</a>:</h4>
<p>aa ok good, thanks</p>



<a name="207142792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142792">(Aug 17 2020 at 13:22)</a>:</h4>
<p>if you want an easy first issue <a href="https://github.com/rust-lang/rust/issues/75080">https://github.com/rust-lang/rust/issues/75080</a> is good</p>



<a name="207142806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142806">(Aug 17 2020 at 13:22)</a>:</h4>
<p>lots of work to be done but no deep knowledge of the compiler needed</p>



<a name="207142848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207142848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hossein dindar <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207142848">(Aug 17 2020 at 13:22)</a>:</h4>
<p>great, I will take a look at it, thanks</p>



<a name="207143058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207143058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207143058">(Aug 17 2020 at 13:24)</a>:</h4>
<p>wow people actually made a dent in it <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> I was expect it to take weeks</p>



<a name="207143400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/chaining%20of%20comparisons/near/207143400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/chaining.20of.20comparisons.html#207143400">(Aug 17 2020 at 13:27)</a>:</h4>
<p>In general <code>E-easy</code> or <code>E-mentor</code> issues are good first issues</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>